package com.yuanfeng.order.feign;

import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Stranger
 * @date 2023/3/20 15:49
 */
@FeignClient(name = "mall-base", url = "http://localhost:8011")
public interface BaseServiceClient {
    /**
     * 根据会员等级id查询会员等级
     * @param id
     * @return
     */
    @PostMapping("/base/membershipGrade/getMemberNameByClassId")
    ResponseResult getMemberNameByClassId(@RequestParam("id") String id);

    @PostMapping("baseDealerSet/settingDistribute/query")
    ResponseResult settingDistribute();

    /**
     * 查询微客配置
     * @return
     */
    @GetMapping("baseVkSet/queryGoodsVkSet")
    ResponseResult queryGoodsVkSet();


    /**
     * 查询plus 会员规则  feign
     */
    @PostMapping("base/merchantPlusRule/query")
    ResponseResult queryMerchantPlusRule();

    /**
     * 查询积分规则
     *
     * @return
     */
    @PostMapping("/base/integralRules/queryIntegralRules")
    ResponseResult queryIntegralRules();

    /**
     * 查询快递表信息
     *
     * @param orderShippingExpressId
     * @return
     */
    @PostMapping("/base/kdniaoExpresss/query/kdniaoExpresssInfo")
    ResponseResult queryKdniaoExpresssInfo(@RequestBody Integer orderShippingExpressId);

    /**
     * 查询快递公司列表
     *
     * @param map
     * @return
     */
    @PostMapping("/base/express/list/query")
    ResponseResult queryExpressList(@RequestBody Map<String, Object> map);

    /**
     * 根据id查询快递信息
     *
     * @param expressId
     * @return
     */
    @GetMapping("/base/express/getInfoById")
    ResponseResult getBaseExpressInfoById(@RequestParam("expressId") Integer expressId);


    /**
     * 查询快递鸟配置  服务间feign 调用使用
     *
     * @return
     */
    @PostMapping("/base/kdniaoConfig/feign/queryConfig")
    ResponseResult queryConfigFeign();

    /**
     * 得到地址信息
     *
     * @param provinceId
     * @param cityId
     * @param districtId
     * @return
     */
    @GetMapping("/base/district/getAddressString")
    ResponseResult getAddressString(@RequestParam("province") Integer provinceId, @RequestParam("city") Integer cityId,
                            @RequestParam("county") Integer districtId);


    /**
     * 查询地区表所对应的名称
     *
     * @param districtMap
     * @return
     */
    @PostMapping("/base/district/queryRegionName")
    List<String> queryRegionName(@RequestBody Map<String, Integer> districtMap);

    /**
     * 查询地区
     * @param provinceId
     * @return
     */
    @PostMapping("/base/district/queryProvinceport")
    String queryProvinceport(@RequestParam("provinceId") String provinceId);

    /**
     * 根据configKey 查询配置 feign
     */
    @PostMapping("base/sysConfig/queryConfigKeyFeign")
    String selectConfigValueFeign(@RequestParam("configKey") String configKey);

    @PostMapping("/baseVkSet/updateOrderAfterSale")
    ResponseResult updateOrderAfterSale(@RequestParam("orderId") String orderId);

    @GetMapping("/base/express/queryBaseExpressById")
    String queryBaseExpressById(@RequestParam("orderShippingExpressId") Integer orderShippingExpressId);
}
